home *** CD-ROM | disk | FTP | other *** search
- Date: 7/27/94
- ====
-
- Name: LabelDrv
- ====
-
- Environment:
- ===========
- Director 4.0 for Windows XObject.
-
- Author: Greg Yachuk
- ====== 3773 20th Street
- San Francisco, CA 94110
- greggy@shell.portal.com
-
- Usage:
- =====
-
- Quite often, you want to leave your content on a CDROM, because it would
- take too much room on a hard disk. However, you want your projector to
- be on the hard drive so that it loads quicker.
-
- This leaves you with the problem of identifying the CDROM drive at run time.
- DOS refers to all mounted drives by drive letter, but does not guarantee
- what the letter will be between configurations.
-
- LabelDrv helps you identify your drive, by making use of the Volume Label
- which placed on the CDROM. DOS allows certain special files at the root
- level to be designated as Volume Labels. This XObject will search a set
- of drive letters for a volume label that matches the one passed in.
-
- If intervening drive letters don't exist, or if media is not mounted, the
- drive letters will be skipped over. There will be a timeout period, but the
- user will not be presented with a dialog box.
-
-
- Description:
- ===========
-
- Method: mNew --Creates a new instance of the XObject.
- ----
- Params: none
- Return: Object handle
- Notes: none
-
-
- Method: mDispose --Disposes of XObject instance.
- --------
- Params: none
- Return: none
- Notes: none
-
-
- Method: mSetRange --Sets the drive letters to begin and end the search
- --------- --for the label. Default is C..Z.
- Params: StartAt (string) => First character is the drive letter to start at.
- EndAt (string) => First character is the drive letter to end at.
- Return: none
- Notes: The first character of each string is used as the drive letters
- which bound the search for a volume label. No error checking is
- done on these values.
-
- You need to ensure that the characters are alphabetic and that
- StartAt is less than EndAt.
-
- The input parameters are not case sensitive.
-
-
- Method: mGetDrive --Return the drive letter where the specified label
- --------- --is mounted.
- Params: Label (string) => Volume label to be searched for.
- Return: String containing the DOS drive letter where the volume label was found.
- Notes: none
-
-
- Example:
- =======
-
- on startMovie
- --
- -- Load the XObject
- --
- openXlib "LabelDrv"
-
- --
- -- Instantiate an object
- --
- set ld = LabelDrv(mNew)
-
- --
- -- Machines in Japan use Drive A as the hard drive. Start looking here.
- --
- ld(mSetRange, "A", "Z")
-
- --
- -- Look for a drive with "MY GAME" as the Volume Label.
- --
- set drive = ld(mGetDrive, "My Game")
-
- --
- -- Set up a string pointing to the movie's directory, but on the CDROM
- -- rather than on the hard disk.
- --
- set CDROMPath = the moviePath
- set char 1 of CDROMPath = char 1 of drive
-
- --
- -- Use the searchPath to make sure we always look relative to the CDROM.
- --
- setAt the searchPath, 1, CDROMPath
- set the searchCurrentFolder = FALSE
-
- --
- -- Clean up after ourselves.
- --
- ld(mDispose)
-
- end startMovie
-